/*
 * Main.fx
 *
 * Created on Feb 13, 2010, 11:28:35 AM
 */

package dawnland03.ui;

import javafx.stage.Stage;
import javafx.scene.Scene;

import dawnland03.service.GeneralFacade;
import dawnland03.ui.service.UIService;
import javafx.scene.Group;
import javafx.scene.layout.Container;
import dawnland03.ui.model.UIMatrix;
import javafx.scene.Node;
import javafx.geometry.VPos;
import javafx.scene.layout.HBox;
import dawnland03.ui.model.UIEntityPanel;

/**
 * @author user
 */

 /*
  main javafx function
 */

    function run() : Void {
        GeneralFacade.testThreads();
        def uiMatrix = UIService.getUIService().getUIMatrix();
        def uiEntities =  UIService.getUIService().getUIEntities();
        var board = createBoard(uiMatrix, uiEntities);
        var entityPanel = createEntityPanel();
        var scene: Scene;
        scene = Scene {
        content: HBox {
           content: [board, entityPanel]
           nodeVPos: VPos.TOP
        }



        /*content: ScrollView {

            node: Group{
                content: [uiMatrix, UIService.getUIService().getUIEntities()]
                }
            pannable: true,
            width: bind scene.width
            height: bind scene.height
            hbarPolicy: ScrollBarPolicy.NEVER
            vbarPolicy: ScrollBarPolicy.NEVER
            }*/
        }

    Stage {
        title: "Dawnland v0.3"
        scene: scene;
        resizable: false       
        }
}

function createBoard(uiMatrix:UIMatrix, uiEntities:Group):Container{
    Container {
        content:[uiMatrix, uiEntities]
    }

}

function createEntityPanel():Node{
    UIService.getUIService().getUIEntityPanel();
}


